<%--
 *  File:    ActivityPropertyPop.jsp
 *  @Author: Dcdai
 *  Date:    2011-08-05

 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.OvalLabel" %>
<%@ page import="com.oval.util.OvalCustomMessage" %>
<%@ page import="com.oval.util.OvalCustomColumn" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  String privilegeCode = "11203";
  String strTableName = "v_activityproperty";
  String strModuleName = "CRM";
  HashMap userinfo = new HashMap();
  userinfo = (HashMap)session.getAttribute("userinfo");
  Integer neworgid=new Integer(-1);
  if(userinfo.get("orgid")!=null)
  neworgid = (Integer)userinfo.get("orgid");

%>



<%@ include file="/inc/PageDefault.inc" %>
<%@include file="/inc/Print.inc"%>
<%@ include file="/inc/FrmDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc" %>
<html>
<head>
<title>ActivityPropertyPop</title>
<PageFlow:CheckPageFlow pageName="p_activitypropertysummary"/>
<%

%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<iframe name="reloadHandler" style="display:none" ></iframe>
<script>

function clickProd(id,num)
{
  document.actionsummaryform.chooseactionid.value = id;
  document.actionsummaryform.chooseindexnum.value = num;
}
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(actionsummaryform,actionvalue,orderbyname);
  editform.action = "ActivityPropertyPop.jsp?<%= OvalTools.randomURL() %>&selectopt=all";  
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function ajax_finish () {
	var idxnum  = document.actionsummaryform.chooseindexnum.value;
	var actionid = document.actionsummaryform.chooseactionid.value;
	var activitypropertycode = "activitypropertycode"+idxnum;
	var activitypropertycode = document.getElementById(activitypropertycode).value;
	var activitypropertyname = "activitypropertyname"+idxnum;
	var activitypropertyname = document.getElementById(activitypropertyname).value;
	var description = "description"+idxnum;
	var description = document.getElementById(description).value;
	var needprod = "needprod"+idxnum;
	var needprod = document.getElementById(needprod).value;
	var valuename = "valuename"+idxnum;
	var valuename = document.getElementById(valuename).value;
	//var type1 = "type1"+idxnum;
	//var type = document.getElementById(type1).value;
	var needorg = "needorg"+idxnum;
	var needorg = document.getElementById(needorg).value;
	var needemployee = "needemployee"+idxnum;
	var needemployee = document.getElementById(needemployee).value;		
	//var feedbacktype = "feedbacktype"+idxnum;
	//var feedbacktype = document.getElementById(feedbacktype).value;
	opener.page_setactionid(actionid,activitypropertycode,activitypropertyname,description,needprod,valuename,needorg,needemployee);
	window.close();
	
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
 <form name="actionsummaryform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="p_activitypropertysummary">
      	<input type="hidden" name="actionname">
      	 <%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
    <td>
      <table width="100%" border="0" cellspacing="0">
        <tr>
          <td class="summary_top" colspan="2" ></td>
        </tr>
	<%@ include file="/inc/SummarySearch.inc" %>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">

        <tr class="deepblue-left">
          <td width="5%" class="title_center">&nbsp;</td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_ConfigCode") %></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_ConfigName") %></td>
          <td width="20%" class="title_center"><%= label.getLabelName("L_Description") %></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_ConfigType") %></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_sourcetype ") %></td>
          <td width="8%" class="title_center"><%= label.getLabelName("L_YorN") + label.getLabelName("L_MoneyCent") + label.getLabelName("L_Product")%></td>
          <td width="8%" class="title_center"><%= label.getLabelName("L_YorN") + label.getLabelName("L_MoneyCent") + label.getLabelName("L_Client")%></td>
          <td width="8%" class="title_center"><%= label.getLabelName("L_YorN") + label.getLabelName("L_MoneyCent") + label.getLabelName("L_org")%></td>
          <td width="10%" class="title_center"><%= label.getLabelName("L_RelatedTranCode1") %></td>
          <!-- 
          <td width="20%" class="title_center"><a href="javascript:page_summary('orderby','sqldesc')"><%= label.getLabelName("L_SQL ") %></a></td>
           -->
        </tr>
        <%int i=0; %>
            <%
                        Vector totalsummary = (Vector) pageContext.getAttribute("totalsummary");
                        if (totalsummary == null)
                            totalsummary = new Vector();
                       Vector actionsourcecollection = (Vector) pageContext.getAttribute("actionsourcecollection");
                        if (actionsourcecollection == null)
                            actionsourcecollection = new Vector();
                            boolean bHasChecked = false;
                             String strClassType = new String("");

               %>
	 <logic:iterate id="actionhash" collection="<%=totalsummary%>" indexId="orderid">
	 <%
	 String strIsChecked ="";
	 		            if(i%2 == 1)
            {
              strClassType = "td-listrom";
            }else{
              strClassType = "none";
            }
	      if(!bHasChecked)
            {
              strIsChecked = "checked";
              bHasChecked = true; %>
         <input type="hidden" name="chooseactionid"  id="chooseactionid" value="<custom:write property="activitypropertyid" name="actionhash" nbsp="true"/>">
          <input type="hidden" name="chooseindexnum"  id="chooseindexnum" value="<%=JspHelper.filterNull(orderid)%>">

            <%   }
              i++;
	 %>
	 <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull(strClassType)%>'"  onClick="javascript:radiotrue('action<%=JspHelper.filterNull(i)%>');clickProd('<custom:write property="activitypropertyid" name="actionhash"/>','<%=JspHelper.filterNull(orderid)%>');" class="<%=JspHelper.filterNull( strClassType )%>" >
	 <td>
	 <input id="action<%=JspHelper.filterNull(i)%>" type="radio"  name="activitypropertyid" value="<custom:write property="activitypropertyid" name="actionhash"/>"
	 onClick="javascript:clickProd('<custom:write property="activitypropertyid" name="actionhash" nbsp="true"/>','<%=JspHelper.filterNull(orderid)%>')" Class="normalradio" <%=strIsChecked%>/>
	 </td>
	 <td><custom:write property="activitypropertycode" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="activitypropertycode" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>
	 </td>
	 <td><custom:write property="activitypropertyname" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="activitypropertyname" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>
	 </td>
	 <td><custom:write property="description" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="description" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>
	 <td><custom:write property="valuename" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="valuename" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>
	 <td><custom:write property="sourcetypedesc" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="sourcetypedesc" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>
	 <td class="title_center">
	     <custom:write property="needprod" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="needprod" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>
	 <td class="title_center">
	     <custom:write property="needorg" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="needorg" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>
	 <td class="title_center">
	     <custom:write property="needemployee" name="actionhash" nbsp="true" />
	 	 <custom:hidden property="needemployee" name="actionhash" colIndex="<%=orderid %>"></custom:hidden>	 
	 </td>	 
	 <td><custom:write property="relatedcode" name="actionhash" nbsp="true" /></td>
	 <!-- 
	 <td><custom:write property="sqldesc" name="actionhash" nbsp="true" /></td>
	  -->
	 </tr>
	 </logic:iterate>
	 
	          <%@ include file="/inc/SummaryAction.inc" %>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="summary_top" ></td>
        </tr>
        <tr>
          <td class="td_center">
          <input type="hidden" name="neworgid" value="<%=neworgid%>">
          <input type="hidden" name="delactivitypropertyid">
          <a onclick="ajax_finish();"><custom:button type="1" label="L_Finish" imgsrc="new.gif" border="0" style="width:60"/></a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
 </form>
</body>
</html>